import request from "@/utils/request";

// 查询外派管理列表
export function listDispatch(query) {
  return request({
    url: "/service/dispatches/list",
    method: "get",
    params: query,
  });
}

// 查询外派管理详细
export function getDispatch(id) {
  return request({
    url: "/service/dispatches/" + id,
    method: "get",
  });
}

// 新增外派管理
export function addDispatch(data) {
  return request({
    url: "/service/dispatches",
    method: "post",
    data: data,
  });
}

// 修改外派管理
export function updateDispatch(data) {
  return request({
    url: "/service/dispatches",
    method: "put",
    data: data,
  });
}

// 删除外派管理
export function delDispatch(id) {
  return request({
    url: "/service/dispatches/" + id,
    method: "delete",
  });
}
export function updateStatus(data) {
  return request({
    url: `/service/dispatches/${data.id}/termination`,
    method: "post",
    data: data,
  });
}
